﻿using System;
using System.Collections.Generic;
using System.ComponentModel;

using Matchingo.Common.Types.Types;
using Matchingo.Common.Types.EventArguments;

namespace Matchingo.Common.Types.Interfaces
{
    /// <summary>
    /// The IHighScoreProvider is an object which provides all the game records which are on the high score board
    /// </summary>
	/// <remarks>this interface is used by all HighScoreProviders</remarks>
    public interface IHighScoreProvider : INotifyPropertyChanged
    {
        /// <summary>
        /// You must call this method to initialize before making use of any other methods/properties of this object
        /// </summary>
        void Initialize();

        /// <summary>
        /// Add a game record to the highscore list
        /// </summary>
        /// <param name="g">The Game to add</param>
        /// <param name="saveAsynchronously">Persist the data synchronously or asynchronously (avoid disk access lag time)</param>
        void AddRecord(Game g, bool saveAsynchronously);

        /// <summary>
        /// Gets a listing of the top XX number of highscores
        /// </summary>
        /// <param name="topNCount">The number of records to choose from the top</param>
        /// <returns>A list of the top XX number of highscores from the available highscores list</returns>
        List<Game> GetHighScoresByCardCount(int topNCount, int cardCount);

		/// <summary>
        /// An event which fires whenever a new highscore record has been added
        /// </summary>
        event EventHandler<GameRecordAddedEventArgs> RecordAdded;
    }
}
